package pkg

import (
	"github.com/gin-gonic/gin"
	"strings"
)

type Ids struct {
	Ids []int
}

func IdsStrToIdsIntGroup(key string, c *gin.Context) []int {
	return IdsStrToIdsIntGroupStr(c.Param(key))
}

func IdsStrToIdsIntGroupStr(keys string) []int {
	IDS := make([]int, 0)
	ids := strings.Split(keys, ",")
	for _, id := range ids {
		ID, _ := StringToInt(id)
		IDS = append(IDS, ID)
	}

	return IDS

}
